package cn.wjzhang.middle.modules.bank.controller;


import cn.wjzhang.core.beans.vo.Result;
import cn.wjzhang.middle.modules.bank.beans.request.MidBankLhhListRequest;
import cn.wjzhang.middle.modules.bank.beans.vo.MidBankLhhVo;
import cn.wjzhang.middle.modules.bank.service.MidBankLhhService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 银行联行号Controller层
 *
 * @author wjzhang
 * @date 2023-06-28 15:35:26
 */
@Slf4j
@Api(tags = "银行联行号")
@RestController
@RequestMapping("/v1/midbanklhh")
public class MidBankLhhController {
    @Resource
    private MidBankLhhService midBankLhhService;

    @ApiOperation("银行联行号-分页列表查询")
    @GetMapping("/list")
    public Result<IPage<MidBankLhhVo>> queryPageList(MidBankLhhListRequest param) {
        return Result.ok(midBankLhhService.listWithPage(param));
    }

//    @ApiOperation("银行联行号-添加")
//    @PostMapping("/add")
//    public Result<Long> add(@Validated @RequestBody MidBankLhhAddRequest addRequest) {
//        return Result.ok(this.midBankLhhService.addMidBankLhh(addRequest));
//    }
//
//    @ApiOperation("银行联行号-编辑")
//    @PostMapping("/edit")
//    public Result edit(@Validated @RequestBody MidBankLhhEditRequest editRequest) {
//        this.midBankLhhService.editMidBankLhh(editRequest);
//        return Result.ok();
//    }
//
//    @ApiOperation("银行联行号-通过id删除")
//    @PostMapping("/delete")
//    public Result delete(@RequestParam(name = "id") Long id) {
//        this.midBankLhhService.removeByIdLogic(id);
//        return Result.ok();
//    }

    @ApiOperation("银行联行号-通过id查询")
    @GetMapping("/queryById")
    public Result<MidBankLhhVo> queryById(@RequestParam(name = "id") Long id) {
        return Result.ok(midBankLhhService.getDTO(id));
    }
}
